package forms;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;


import model.*;

public class ChairsForm extends ActionForm {
	
	private static final long serialVersionUID = 3L;
	
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		
		System.err.println("The Form is getting called");
		
		ActionErrors errors = new ActionErrors();
		
		if(mapping.getPath().equals("/pages/chairs/StartReviewProcess")){
			
			System.err.println("mapping in Form is correct");
		
			if (StudentDBModel.canWeStartReviewing() ){
				
			}
			else{
				errors.add("notEnoughReviewers", new ActionMessage("errors.notEnoughReviewers.required"));
				
			}
			
		}
		
		return errors;
	}

}
